<?php
/**
 * Created by PhpStorm.
 * User: apple
 * Date: 2018/9/1
 * Time: 下午5:15
 */
namespace PddWechat\Models\User\Service;

use Dai\Framework\Base\BaseSessionInfo;
use PddWechat\Models\User\Data\WithdrawCashData;

class UserWithdrawMoney
{
    public function __construct()
    {
        $this->withdrawCashData = new WithdrawCashData();
    }

    public function execute($basePageInfo)
    {
        /** @var BaseSessionInfo $sessionData */
        $sessionData = $basePageInfo->sessionInfo;
        $uid = $sessionData->uid;
        $userWithdrawedMoney = $this->withdrawCashData->selectUserWithdrawDataByUid($uid ,1);
        $userWithdrawingMoney = $this->withdrawCashData->selectUserWithdrawDataByUid($uid ,0);
        $res = [
            'withdrawedMoney' => $userWithdrawedMoney,
            'withdrawingMoney' => $userWithdrawingMoney,
        ];
        return $res;
    }
}